//获取url参数函数
function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null)
        return  unescape(r[2]);
    return null;
}
//导航栏操作(选中样式)
$('#navbar a').eq(parseInt(GetQueryString('module'))).addClass('selected').siblings().removeClass('selected');
//搜索框分类选中样式
$('#select span').click(function () {
    $('#select span').removeClass('yellow');
    $(this).addClass('yellow');
});
//获取cookie
var account = Cookie.Get("account");

if (account != undefined && account != false) {
    $('#phone a').last().text("退出登录");
    $('#act').show().text(account);
    $('#phone a').first().show();
    $('#wode').prev().hide();
}
//点击退出登录
$('#phone a').last().click(function () {
    Cookie.Set("account", "", -1);
    Cookie.Set("level", "", -1);
    Cookie.Set("myid", "", -1);
    Cookie.Set("learn", "", -1);
    login.text("登录");
    document.location = "/index.jsp";
});
//项目类别


$('#sousuo').submit(function () {
    var lei = $('span.yellow').text();
    if (lei == "项目") {
        $(this).attr("action", "/search_results");
    } else {
        $(this).attr("action", "/search_qiye");
    }
});


